﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OsobaRadniOdnos typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OsobaRadniOdnosDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OsobaRadniOdnosDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OsobaRadniOdnos _currentOsobaRadniOdnos = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOsobaRadniOdnosDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOsobaRadniOdnosErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOsobaRadniOdnosBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDRadniOdnosTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDRadniOdnosTipDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsobaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Napomena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNapomenaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IzvanOrganizacije property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxIzvanOrganizacijeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the NazivVanjskeOrganizacije property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNazivVanjskeOrganizacijeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DnevniBrojRadnihSati property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDnevniBrojRadnihSatiDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the SubotaRadna property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxSubotaRadnaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazMjeseci1 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazMjeseci1DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazMjeseci2 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazMjeseci2DataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Osoba> _IDOsobaList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDOsobaList
		{
			get {return this._IDOsobaList;}
			set 
			{
				this._IDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DataSource = null;
				this.uxIDOsobaDataGridViewColumn.DataSource = this._IDOsobaList;
			}
		}
		
		private bool _allowNewItemInIDOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsobaList
		{
			get { return _allowNewItemInIDOsobaList;}
			set
			{
				this._allowNewItemInIDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.RadniOdnosTip> _IDRadniOdnosTipList;
		
		/// <summary> 
		/// The list of selectable RadniOdnosTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.RadniOdnosTip> IDRadniOdnosTipList
		{
			get {return this._IDRadniOdnosTipList;}
			set 
			{
				this._IDRadniOdnosTipList = value;
				this.uxIDRadniOdnosTipDataGridViewColumn.DataSource = null;
				this.uxIDRadniOdnosTipDataGridViewColumn.DataSource = this._IDRadniOdnosTipList;
			}
		}
		
		private bool _allowNewItemInIDRadniOdnosTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of RadniOdnosTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDRadniOdnosTipList
		{
			get { return _allowNewItemInIDRadniOdnosTipList;}
			set
			{
				this._allowNewItemInIDRadniOdnosTipList = value;
				this.uxIDRadniOdnosTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OsobaRadniOdnos> _OsobaRadniOdnosList;
				
		/// <summary> 
		/// The list of OsobaRadniOdnos to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OsobaRadniOdnos> OsobaRadniOdnosList
		{
			get {return this._OsobaRadniOdnosList;}
			set
			{
				this._OsobaRadniOdnosList = value;
				this.uxOsobaRadniOdnosBindingSource.DataSource = null;
				this.uxOsobaRadniOdnosBindingSource.DataSource = value;
				this.uxOsobaRadniOdnosDataGridView.DataSource = null;
				this.uxOsobaRadniOdnosDataGridView.DataSource = this.uxOsobaRadniOdnosBindingSource;				
				//this.uxOsobaRadniOdnosBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOsobaRadniOdnosBindingSource_ListChanged);
				this.uxOsobaRadniOdnosBindingSource.CurrentItemChanged += new System.EventHandler(OnOsobaRadniOdnosBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOsobaRadniOdnosBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOsobaRadniOdnos = uxOsobaRadniOdnosBindingSource.Current as Entities.OsobaRadniOdnos;
			
			if (_currentOsobaRadniOdnos != null)
			{
				_currentOsobaRadniOdnos.Validate();
			}
			//_OsobaRadniOdnos.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOsobaRadniOdnosBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OsobaRadniOdnos"/> instance.
		/// </summary>
		public Entities.OsobaRadniOdnos SelectedOsobaRadniOdnos
		{
			get {return this._currentOsobaRadniOdnos;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOsobaRadniOdnosDataGridView.VirtualMode;}
			set
			{
				this.uxOsobaRadniOdnosDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOsobaRadniOdnosDataGridView.AllowUserToAddRows;}
			set {this.uxOsobaRadniOdnosDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOsobaRadniOdnosDataGridView.AllowUserToDeleteRows;}
			set {this.uxOsobaRadniOdnosDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOsobaRadniOdnosDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOsobaRadniOdnosDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OsobaRadniOdnosDataGridViewBase"/> class.
		/// </summary>
		public OsobaRadniOdnosDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOsobaRadniOdnosDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOsobaRadniOdnosBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOsobaRadniOdnosErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDRadniOdnosTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDatumOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNapomenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIzvanOrganizacijeDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDnevniBrojRadnihSatiDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSubotaRadnaDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxStazMjeseci1DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStazMjeseci2DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDOsobaBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).BeginInit();
			//this.uxIDRadniOdnosTipBindingSource = new RadniOdnosTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDRadniOdnosTipBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadniOdnosDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadniOdnosBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadniOdnosErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOsobaRadniOdnosErrorProvider
			// 
			this.uxOsobaRadniOdnosErrorProvider.ContainerControl = this;
			this.uxOsobaRadniOdnosErrorProvider.DataSource = this.uxOsobaRadniOdnosBindingSource;						
			// 
			// uxOsobaRadniOdnosDataGridView
			// 
			this.uxOsobaRadniOdnosDataGridView.AutoGenerateColumns = false;
			this.uxOsobaRadniOdnosDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOsobaRadniOdnosDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDRadniOdnosTipDataGridViewColumn,
		this.uxIDOsobaDataGridViewColumn,
		this.uxDatumOdDataGridViewColumn,
		this.uxDatumDoDataGridViewColumn,
		this.uxNapomenaDataGridViewColumn,
		this.uxIzvanOrganizacijeDataGridViewColumn,
		this.uxNazivVanjskeOrganizacijeDataGridViewColumn,
		this.uxDnevniBrojRadnihSatiDataGridViewColumn,
		this.uxSubotaRadnaDataGridViewColumn,
		this.uxStazMjeseci1DataGridViewColumn,
		this.uxStazMjeseci2DataGridViewColumn			});
			this.uxOsobaRadniOdnosDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOsobaRadniOdnosDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOsobaRadniOdnosDataGridView.Name = "uxOsobaRadniOdnosDataGridView";
			this.uxOsobaRadniOdnosDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOsobaRadniOdnosDataGridView.TabIndex = 0;	
			this.uxOsobaRadniOdnosDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOsobaRadniOdnosDataGridView.EnableHeadersVisualStyles = false;
			this.uxOsobaRadniOdnosDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOsobaRadniOdnosDataGridViewDataError);
			this.uxOsobaRadniOdnosDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaRadniOdnosDataGridViewCellValueNeeded);
			this.uxOsobaRadniOdnosDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaRadniOdnosDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDRadniOdnosTipDataGridViewColumn
			//
			this.uxIDRadniOdnosTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDRadniOdnosTipDataGridViewColumn.DataPropertyName = "IDRadniOdnosTip";
			this.uxIDRadniOdnosTipDataGridViewColumn.HeaderText = "IDRadniOdnosTip";
			this.uxIDRadniOdnosTipDataGridViewColumn.Name = "uxIDRadniOdnosTipDataGridViewColumn";
			this.uxIDRadniOdnosTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDRadniOdnosTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDRadniOdnosTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//
			this.uxIDOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaDataGridViewColumn.DataPropertyName = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.HeaderText = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.Name = "uxIDOsobaDataGridViewColumn";
			this.uxIDOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumOdDataGridViewColumn
			//
			this.uxDatumOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumOdDataGridViewColumn.DataPropertyName = "DatumOd";
			this.uxDatumOdDataGridViewColumn.HeaderText = "DatumOd";
			this.uxDatumOdDataGridViewColumn.Name = "uxDatumOdDataGridViewColumn";
			this.uxDatumOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDoDataGridViewColumn
			//
			this.uxDatumDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDoDataGridViewColumn.DataPropertyName = "DatumDo";
			this.uxDatumDoDataGridViewColumn.HeaderText = "DatumDo";
			this.uxDatumDoDataGridViewColumn.Name = "uxDatumDoDataGridViewColumn";
			this.uxDatumDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxNapomenaDataGridViewColumn
			//
			this.uxNapomenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNapomenaDataGridViewColumn.DataPropertyName = "Napomena";
			this.uxNapomenaDataGridViewColumn.HeaderText = "Napomena";
			this.uxNapomenaDataGridViewColumn.Name = "uxNapomenaDataGridViewColumn";
			this.uxNapomenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNapomenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNapomenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIzvanOrganizacijeDataGridViewColumn
			//
			this.uxIzvanOrganizacijeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIzvanOrganizacijeDataGridViewColumn.DataPropertyName = "IzvanOrganizacije";
			this.uxIzvanOrganizacijeDataGridViewColumn.HeaderText = "IzvanOrganizacije";
			this.uxIzvanOrganizacijeDataGridViewColumn.Name = "uxIzvanOrganizacijeDataGridViewColumn";
			this.uxIzvanOrganizacijeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIzvanOrganizacijeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIzvanOrganizacijeDataGridViewColumn.ReadOnly = false;		
			//
			// uxNazivVanjskeOrganizacijeDataGridViewColumn
			//
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.DataPropertyName = "NazivVanjskeOrganizacije";
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.HeaderText = "NazivVanjskeOrganizacije";
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.Name = "uxNazivVanjskeOrganizacijeDataGridViewColumn";
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNazivVanjskeOrganizacijeDataGridViewColumn.ReadOnly = false;		
			//
			// uxDnevniBrojRadnihSatiDataGridViewColumn
			//
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.DataPropertyName = "DnevniBrojRadnihSati";
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.HeaderText = "DnevniBrojRadnihSati";
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.Name = "uxDnevniBrojRadnihSatiDataGridViewColumn";
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.ReadOnly = false;		
			//
			// uxSubotaRadnaDataGridViewColumn
			//
			this.uxSubotaRadnaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSubotaRadnaDataGridViewColumn.DataPropertyName = "SubotaRadna";
			this.uxSubotaRadnaDataGridViewColumn.HeaderText = "SubotaRadna";
			this.uxSubotaRadnaDataGridViewColumn.Name = "uxSubotaRadnaDataGridViewColumn";
			this.uxSubotaRadnaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSubotaRadnaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSubotaRadnaDataGridViewColumn.ReadOnly = false;		
			//
			// uxStazMjeseci1DataGridViewColumn
			//
			this.uxStazMjeseci1DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazMjeseci1DataGridViewColumn.DataPropertyName = "StazMjeseci1";
			this.uxStazMjeseci1DataGridViewColumn.HeaderText = "StazMjeseci1";
			this.uxStazMjeseci1DataGridViewColumn.Name = "uxStazMjeseci1DataGridViewColumn";
			this.uxStazMjeseci1DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazMjeseci1DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazMjeseci1DataGridViewColumn.ReadOnly = false;		
			//
			// uxStazMjeseci2DataGridViewColumn
			//
			this.uxStazMjeseci2DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazMjeseci2DataGridViewColumn.DataPropertyName = "StazMjeseci2";
			this.uxStazMjeseci2DataGridViewColumn.HeaderText = "StazMjeseci2";
			this.uxStazMjeseci2DataGridViewColumn.Name = "uxStazMjeseci2DataGridViewColumn";
			this.uxStazMjeseci2DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazMjeseci2DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazMjeseci2DataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//				
			this.uxIDOsobaDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsobaDataGridViewColumn.DataSource = uxIDOsobaBindingSource;				
				
			//
			// uxIDRadniOdnosTipDataGridViewColumn
			//				
			this.uxIDRadniOdnosTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDRadniOdnosTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDRadniOdnosTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDRadniOdnosTipDataGridViewColumn.DataSource = uxIDRadniOdnosTipBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOsobaRadniOdnosDataGridView);
			this.Name = "OsobaRadniOdnosDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDRadniOdnosTipBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadniOdnosErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadniOdnosDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadniOdnosBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OsobaRadniOdnosDataGridViewEventArgs args = new OsobaRadniOdnosDataGridViewEventArgs();
				args.OsobaRadniOdnos = _currentOsobaRadniOdnos;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OsobaRadniOdnosDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OsobaRadniOdnos	_OsobaRadniOdnos;
	
			/// <summary>
			/// the  Entities.OsobaRadniOdnos instance.
			/// </summary>
			public Entities.OsobaRadniOdnos OsobaRadniOdnos
			{
				get { return _OsobaRadniOdnos; }
				set { _OsobaRadniOdnos = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOsobaRadniOdnosDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaRadniOdnosDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOsobaRadniOdnosDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaRadniOdnosDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaRadniOdnosDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].ID;
						break;
					case "uxIDRadniOdnosTipDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].IDRadniOdnosTip;
						break;
					case "uxIDOsobaDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].IDOsoba;
						break;
					case "uxDatumOdDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].DatumOd;
						break;
					case "uxDatumDoDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].DatumDo;
						break;
					case "uxNapomenaDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].Napomena;
						break;
					case "uxIzvanOrganizacijeDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].IzvanOrganizacije;
						break;
					case "uxNazivVanjskeOrganizacijeDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].NazivVanjskeOrganizacije;
						break;
					case "uxDnevniBrojRadnihSatiDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].DnevniBrojRadnihSati;
						break;
					case "uxSubotaRadnaDataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].SubotaRadna;
						break;
					case "uxStazMjeseci1DataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].StazMjeseci1;
						break;
					case "uxStazMjeseci2DataGridViewColumn":
						e.Value = OsobaRadniOdnosList[e.RowIndex].StazMjeseci2;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOsobaRadniOdnosDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaRadniOdnosDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaRadniOdnosDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDRadniOdnosTipDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].IDRadniOdnosTip = (System.Int32)e.Value;
						break;
					case "uxIDOsobaDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].IDOsoba = (System.Int32)e.Value;
						break;
					case "uxDatumOdDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].DatumOd = (System.DateTime)e.Value;
						break;
					case "uxDatumDoDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].DatumDo = (System.DateTime?)e.Value;
						break;
					case "uxNapomenaDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].Napomena = (System.String)e.Value;
						break;
					case "uxIzvanOrganizacijeDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].IzvanOrganizacije = (System.Boolean)e.Value;
						break;
					case "uxNazivVanjskeOrganizacijeDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].NazivVanjskeOrganizacije = (System.String)e.Value;
						break;
					case "uxDnevniBrojRadnihSatiDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].DnevniBrojRadnihSati = (System.Int32)e.Value;
						break;
					case "uxSubotaRadnaDataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].SubotaRadna = (System.Boolean)e.Value;
						break;
					case "uxStazMjeseci1DataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].StazMjeseci1 = (System.Int32)e.Value;
						break;
					case "uxStazMjeseci2DataGridViewColumn":
						OsobaRadniOdnosList[e.RowIndex].StazMjeseci2 = (System.Int32)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
